<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org/">
<head>
    <meta charset="UTF-8">
    <title>重新发送激活邮件页面</title>
    <link rel="stylesheet" type="text/css" href="/user/css/login.css">
    <script type="text/javascript" src="/user/js/jquery.min.js"></script>
    <script type="text/javascript">
        $(function(){
            $(".name input").focus(function(){
                $(this).prev("i").css({"background-image":"url(/user/img/user2.png)"});
            });
            $(".name input").blur(function(){
                $(this).prev("i").css({"background-image":"url(/user/img/user1.png)"});
            });
            $(".password input").focus(function(){
                $(this).prev("i").css({"background-image":"url(/user/img/password2.png)"});
            });
            $(".password input").blur(function(){
                $(this).prev("i").css({"background-image":"url(/user/img/password1.png)"});
            });
        });


        // 重新发送激活邮件
        function sendActiveMail(){
            //1. 获取用户输入的用户名
            var devUsername = $("#devUsername").val();
            //2. 发送ajax请求.
            $.getJSON(
                "/dev/user/resend-active-mail",
                {"devUsername":devUsername},
                function(result){
                    if(result.code == 0){
                        // 重新发送激活邮件成功
                        location.href = "/dev/user/login-ui";
                    }else{
                        // 发送失败.
                        $("#sendMailInfo").html(result.msg);
                    }
                }
            );
        }

    </script>
</head>
<body>
    <div class="container">
        <div class="wrap">
            <header><em>Logo</em><span>APP应用商店后台</span></header>
            <article>
                <section>
                    <aside>
                        <em>
                            <img src="/user/img/user.png">
                        </em>
                         <form  >
                            <p th:style="'color:red;'" id="sendMailInfo"></p>
                            <p class="name"><i></i><input type="text" id="devUsername" required name="devUsername" class="userName" placeholder="请输入用户名"></p>
                            <button type="button" onclick="sendActiveMail()">重新发送激活邮件</button>
                            <p class="register"><span>没有账号?</span><a th:href="@{/dev/user/register-ui}">立即注册</a></p>
                            <div class="clear"></div>
                        </form>
                    </aside>
                   
                </section>               
            </article>
            <footer>
                <ul>
                    <li><a href="#">联系我们</a></li>
                    <li><a href="#">关于我们</a></li>
                    <li><a href="#">人才招聘</a></li>
                    <li><a href="#">友情链接</a></li>
                    <li><a href="#">公司地址</a></li>
                    <li><a href="#">关注我们</a></li>
                </ul>
                <p>本网站版权归我的技术有限公司所有，未经许可，不得转载。</p>
            </footer>
        </div>
    </div>
</body>
</html>
